import { updateContainer } from "../reconciler/updateContainer";

class ReactDomRoot {
  constructor(public container: HTMLElement) {}

  render(vdom: JSX.Element | any) {
    updateContainer(vdom, this.container);
  } 
}

/**
 * 返回ReactDomRoot实例
 */
export function createRoot(container: HTMLElement): ReactDomRoot {
  return new ReactDomRoot(container);
}

export default {
  createRoot,
};
